1. Field of the Invention
The present invention relates to a printer and method of controlling the saving of information relating to printer operating conditions from volatile memory to nonvolatile memory, and a printer that employs the control method.
2. Description of the Related Art
Correct printer operation requires that the printer have access to information regarding its operating conditions, including certain status information such as the quantity of ink remaining, the time of the last head cleaning, print head location, the amount of roll paper remaining, and count values indicative of such things as the printed character count, the accumulated paper feed amount, and the total operating time. When the printer stops in the middle of a printing job due to some error or other event, such as the power switch being turned off, a power failure, or a printer reset, it is very desirable to know such status information so that the operating conditions of the printer at the time the interruption occurred can be determined and an appropriate process for recovering from the interruption executed.
In conventional printers, status information regarding printer operating conditions as described above (referred to as xe2x80x9cprinter status dataxe2x80x9d below) are maintained and updated in a volatile memory such as a DRAM, and saved at regular intervals to a nonvolatile memory such as an EEPROM (Electrically Erasable Programmable ROM), a flash memory, or other type of nonvolatile memory. Each time the printer resumes operation, the printer status data is copied from the nonvolatile memory into the volatile memory.
As noted above, printer status data is written into the nonvolatile memory at specific time intervals during the operation of the above-described conventional printer. More specifically, at the end of a predetermined time interval, as measured by an internal timer, whatever process the printer is currently performing is interrupted, and the printer CPU is diverted to the task of writing (saving) such data in the nonvolatile memory. By regularly saving the printer status data to the nonvolatile memory, the ability of the printer to recover from printing interruptions and restore the operating status of the printer to its pre-interruption state is improved.
It is obviously not possible to predict when an error or other interruption is going to occur. For this reason, it desirable for the interval between saves of printer status data to the nonvolatile memory to be as short as possible in order to assure that the most recent condition of the printer before an interruption occurs can be determined with the greatest possible accuracy.
When the printer CPU is executing a printing operation or otherwise processing data and is interrupted in order to execute the process of writing printer status data to the nonvolatile memory, the interrupted CPU task (printing or data processing in this example) stops until the writing process is completed. Printer throughput therefore decreases. As the amount of printer status data being tracked and saved to nonvolatile memory increases, the saving time also increases, and can increase to a level at which the decrease in printer throughput can no longer be ignored. It is therefore desirable that the time required for copying data from the volatile memory to the nonvolatile memory each time such data is saved be as short as possible irrespective of the amount of printer status data to be saved.
One of the problems with conventional saving methods is that they copy the entire content of the volatile memory into the nonvolatile memory whenever data saving is initiated, regardless of whether all printer status data in the volatile memory has changed since the last time it was saved. This is inefficient and also reduces the remaining service life of the nonvolatile memory which is inversely related to the number of write cycles to it per unit time. Thus, when data that has not changed is saved to the nonvolatile memory, the limited number of available write cycle operations is needlessly reduced. As a result, the total service life of the nonvolatile memory is potentially shortened.
Therefore, it is an object of the present invention to overcome the aforementioned problems.
It is another object of the present invention to shorten the time during which data is saved to nonvolatile memory and thereby reduce the adverse effect that the saving process has on normal printer operation.
It is a further object of the present invention to prevent the unnecessary saving of data to nonvolatile memory and thereby improve nonvolatile memory service life.
To achieve the above objects, the present invention provides a method for controlling the saving of information regarding printer operating conditions (printer status data) to the nonvolatile memory in the printer. Also provided is printer embodying the save control method. The method comprises the following steps:
(a) grouping the printer status data into a plurality of different data groups and pre-allocating each of the data groups to a corresponding one of a plurality of storage areas in both the printer""s volatile memory and nonvolatile memory, wherein the saving of each data group to the nonvolatile memory is responsive to at least one of a plurality of trigger events; and
(b) generating a command to save a select number of data groups from the volatile memory to the nonvolatile memory when any one of the trigger events occurs; and
(c) saving a particular data group stored in its pre-allocated storage area in the volatile memory to its corresponding storage area in the nonvolatile memory in response to the generated save command when any one of the plurality of trigger events to which that data group is responsive occurs.
By selectively saving only to those storage areas in nonvolatile memory corresponding to a specific trigger event, and not saving to other parts of the nonvolatile memory at that time, the write time is shortened and nonvolatile memory life is improved.
The specific trigger events of this control method preferably include detection of a reset signal from a host computer. In this case, the printer is reset based on this reset signal after step (c).
Preferably, the specific trigger events further include: the lapse of a specific time interval, turning printer power on and off, and specific control events in printer operation. Specific control events in printer operation preferably include print head cleaning, ink cartridge or roll paper replacement, and such operating errors as an increase in print head temperature or disconnection of the carriage transportation belt.
Preferably, the printer status data saved to the nonvolatile memory is also divided into a first data set and a second data set where each data set comprises one or more data groups. In this case, there is an additional step (c)(1)of saving the first data set to the nonvolatile memory at the lapse of a specific time interval; and a step (c)(2)of saving the first and second data sets to the nonvolatile memory and reinitializing the specific time interval counter after a specific printer operation event occurs.
Much of the data saved to the nonvolatile memory is updated in response to the occurrence of a particular control operation, such as the events described above, occur. It is therefore possible to minimize damage from data loss when a problem occurs by writing to the nonvolatile memory after the control event has been completed. By also writing time interval responsive data to the nonvolatile memory at the same time, and also restarting the time counter, an increase in the frequency of data updates to the nonvolatile memory can be prevented.
An error detection code is preferably stored in each storage area, in which case there is also an additional step (d) of checking errors in the storage areas.
In this case, the error detection step checks for errors in the data of a particular storage area when that data is read from the nonvolatile memory and temporarily stored to volatile memory. Further, preferably, the error detection step checks for errors in data after that data is written to the nonvolatile memory from volatile memory.
The control method preferably includes an additional step for writing specific initialization data to each storage area in the volatile memory and the nonvolatile memory from which an error-detected data group has been read or to which an error-detected group has been written. This makes it possible to minimize printer operating problems when a data error occurs.
The present invention also relates to a printer having a memory structure to accommodate the control method. Thus, the printer comprises:
a volatile memory that stores printer status data relating to printer operating conditions, the printer status data being pre-allocated into a plurality of data groups, the volatile memory having a plurality of storage areas allocated therein, each storage area corresponding to one of the data groups;
a nonvolatile memory that temporarily stores the printer status data, the volatile memory having a plurality of storage areas allocated therein corresponding to the plurality of storage areas allocated in the nonvolatile memory;
a controller that generates a save command to save a select number of the data groups stored in the volatile memory to the nonvolatile memory when any one of a plurality of trigger events occurs; and
a read/write unit that saves a particular data group stored in its pre-allocated storage area in the volatile memory to its corresponding storage area in the nonvolatile memory in response to the generated save command when any one of a plurality of trigger events to which that data group is responsive occurs.
The printer status data saved to the nonvolatile memory is preferably pre-divided into a first data set and a second data set. In this case, the printer preferably comprises: a counter for counting a specific time interval; a monitor that detects an occurrence of any one of the trigger events relating to printer operation; a first read/write unit that saves the first data set to nonvolatile memory at the lapse of the specific time interval counted by the counter; a second read/write unit that saves the second data set and the first data set to the nonvolatile memory when the monitor detects the occurrence of at least one specific event in printer operation; and an initialization unit that initializes the counter when the second read/write unit saves data in the nonvolatile memory.
Each storage area preferably comprises a data area for storing its corresponding data group and a checksum area for storing an error detection code.
Preferably, at least one of the plurality of storage areas in the nonvolatile memory is further divided into a plurality of substorage areas. In this case, each substorage area is further preferably divided into a data area and a sequence area for storing sequence data representing the sequence of use of the substorage areas.
The data groups written to the nonvolatile memory when a reset signal is detected are particularly important for printer control. It is therefore necessary to write these data groups to the nonvolatile memory when specific events other than a reset signal occur. Because these data groups are frequently stored, the number of writes to the corresponding storage area inevitably increases. However, by providing plural substorage areas for this frequently updated data, the most recent data can be written sequentially to the subarea following the last subarea used when the data groups are updated. Frequent writing to a single part of the nonvolatile memory can thus be prevented, and a decrease in the nonvolatile memory life resulting from frequent use of only part of the nonvolatile memory can be avoided.
It is also necessary to know which substorage area contains the most recent data when data is read from the nonvolatile memory. Because sequence data is also stored in each substorage area together with its assigned data group, the most recent data can be obtained by simply referring to the sequence data.
Preferably, a checksum area for storing an error detection code is also provided in each substorage area. By thus recording an error detection code, it is also possible to detect data errors when data is read from nonvolatile memory. Furthermore, if an error is detected in the most recent data, the next-most-recent data can be retrieved and checked for errors. If there are no errors in this next-recent data, it can be written to volatile memory. As a result, printer operating errors resulting from possible data errors can be further minimized.
Other objects and attainments together with a fuller understanding of the invention will become apparent and appreciated by referring to the following description and claims taken in conjunction with the accompanying drawings.